package com.yx.study.leet.questionList.questions;

import com.yx.study.leet.utils.ListNode;
import org.junit.Test;

/**
 * 25. K 个一组翻转链表
 * https://leetcode.cn/problems/reverse-nodes-in-k-group/
 */
public class reverseKGroup25 {
    public ListNode reverseKGroup(ListNode head, int k) {
        if (head == null || head.next == null) {
            return head;
        }
        ListNode kNode = new ListNode();
        kNode = head;
        while (true) {
            for (int i = 0; i < k; i++) {
                kNode = kNode.next;
                if (kNode == null) {
                    return kNode;
                }
            }

        }

    }

    private ListNode reverse(ListNode head,ListNode kNode){
        
        return head;
    }

    @Test
    public void test() {

    }
}
